package com.mt.roll.core.dal.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 系统操作日志
 * </p>
 *
 * @author mt
 * @since 2021-12-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_sys_log_operation")
public class SysOperationLog extends Model<SysOperationLog> {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
      @TableId("id")
    private String id;

    /**
     * 请求URI
     */
    @TableField("request_uri")
    private String requestUri;

    /**
     * 请求方式
     */
    @TableField("request_method")
    private String requestMethod;

    /**
     * 请求函数
     */
    @TableField("class_method")
    private String classMethod;

    /**
     * 请求参数
     */
    @TableField("request_params")
    private String requestParams;

    /**
     * 请求时长(毫秒)
     */
    @TableField("request_time")
    private Long requestTime;

    /**
     * 用户代理
     */
    @TableField("user_agent")
    private String userAgent;

    /**
     * 操作ip
     */
    @TableField("request_ip")
    private String requestIp;

    /**
     * 状态（0、失败，1、成功）
     */
    @TableField("state")
    private Integer state;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 创建人
     */
    @TableField("create_user")
    private String createUser;

    /**
     * 创建人名
     */
    @TableField("creator_name")
    private String creatorName;


    public static final String ID = "id";

    public static final String REQUEST_URI = "request_uri";

    public static final String REQUEST_METHOD = "request_method";

    public static final String CLASS_METHOD = "class_method";

    public static final String REQUEST_PARAMS = "request_params";

    public static final String REQUEST_TIME = "request_time";

    public static final String USER_AGENT = "user_agent";

    public static final String REQUEST_IP = "request_ip";

    public static final String STATE = "state";

    public static final String CREATE_TIME = "create_time";

    public static final String CREATE_USER = "create_user";

    public static final String CREATOR_NAME = "creator_name";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
